<script language="javascript" type="text/ecmascript" src="js/form.js"></script>
<script language="javascript" src="js/prototype.js"></script>
<script language="javascript" src="js/ajax.js"></script>
<?php

	session_start();
	include("conex.php");
	import_request_variables("gP");
	include("funciones.php");	

if(isset($btn_guarda)){

    $query = 'delete from aux_registros where id_principal = '.$_SESSION['idprincipal'];
	$res = mysql_query($query, $link) or die(mysql_error().$query);
	if($res) $fin = 1; else $fin = 0;

	$registros = count($sintoma); 
	//echo $registros;
	for($i=0;$i<$registros;$i++){
		$cnt++;
		if($sintoma[$i] == 2){
			$sql = "INSERT INTO aux_registros (id_principal,nDato) VALUES ".
				"(".$_SESSION['idprincipal'].",$cnt)";
//			echo "<br>$sql";
			$res = mysql_query($sql, $link) or die(mysql_error().$sql);
			if($res) $fin = 1; else $fin = 0;
		}
	}

	//if ($fin==1) 
	echo " <table width='750' border='0' align='center' cellpadding='3' cellspacing='3' class='datos'><tr bgcolor='#f3f3f3' align='center'><td>Los Datos Se Registraron Correctamente<br><a href='home.php'>Regresar</a></td></tr></table>";
  
    
}


?>